feat: explicitly throw if TeamTemplate.getRawOrNil gets nil input#7705
Open
ElectricalBoy wants to merge 4 commits into
Open
feat: explicitly throw if TeamTemplate.getRawOrNil gets nil input#7705ElectricalBoy wants to merge 4 commits into
ElectricalBoy wants to merge 4 commits into
Conversation
hjpalpha
approved these changes
Jun 30, 2026
mbergen
approved these changes
Jun 30, 2026
Rathoz
reviewed
Jul 2, 2026
a91eb2d to
ce29ca9
Compare
Rathoz
reviewed
Jul 8, 2026
Comment on lines
-91
to
94
| if Logic.isEmpty(team) then | ||
| return | ||
| end | ||
| assert(team ~= nil, 'TeamTemplate.getRawOrNil: \'team\' must not be nil') | ||
| team = team:gsub('_', ' '):lower() |
Collaborator
There was a problem hiding this comment.
team:gsub throws if team is nil in the current implementation anyway
But that's not fully true? Since there's an early return if it's nil through the Logic Check?
Collaborator
Author
Collaborator
There was a problem hiding this comment.
Is it still work doing then?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Inspiration: #6863 (comment)
This PR adjusts
TeamTemplate.getRawOrNilto explicitly throw ifteamargument isnil.There is no change in behavior (
team:gsubthrows ifteamisnilin the current implementation anyway); this is for making the check explicit and generating a more comprehensive error message.How did you test this change?
trivial